package cn.dw.sg.servlet;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import cn.dw.sg.domain.Role;
import cn.dw.sg.service.RoleService;
import cn.dw.sg.service.impl.RoleServiceImpl;

public class RoleServlet extends HttpServlet{

	
	
	
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		String name=req.getParameter("name");
		String roleId=req.getParameter("roleId");
		
		RoleService role=new RoleServiceImpl();
		
		Role a=new Role();
		a.setName(name);
		a.setRoleId(Integer.parseInt(roleId));
		
		List<Role> result= role.query(a);
		PrintWriter print=resp.getWriter();
		print.write(result.toString());
	}
	

}
